package demo_HelloWorld;

public class Factorial {
	public static void main(String[] args) {
		int i = iterator(3);
		System.out.println(i);
	}
	public static int recursion(int num){
		if(num != 1){
			return num*recursion(num-1);
		}else{
			return 1;
		}
	}
	public static int iterator(int num){
		int recursion =1;
		for(int i =1;i<=num; i++){
			recursion *=i;
		}
		return recursion;
	}
}
